---
title: Accumulate and format display messages
summary: Appends non-duplicate messages to an accumulated display string, and independently formats message arrays for Windows/Web display.
status: draft
owner: SAIF BOF documentation team
last_reviewed: 2026-08-21
library: SAIF.Application
reference_type: embedded
operation_id: OP-APP-004
trigger: Concrete subclass calls AppendMessageLines, or code calls MessageFormatting.GetMessagesForWindows/GetMessagesForWeb/GetMessagesUserDefined
---

# Accumulate and format display messages

This operation covers two independent message-handling paths in this library: `AppManagerBase`'s message-accumulation property, and the standalone `MessageFormatting` utility.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-APP-004 |
| **Trigger** | Concrete subclass calls `AppendMessageLines`; or any caller invokes `MessageFormatting.GetMessagesForWindows`/`GetMessagesForWeb`/`GetMessagesUserDefined` |
| **Inputs** | A message string, array of messages, or `IEnumerable(Of String)` |
| **Outputs** | Updated `AppManagerBase.Message` property, or a concatenated display string |
| **Primary components** | `AppManagerBase.AppendMessageLines`, `MessageFormatting.GetMessagesForWindows`, `MessageFormatting.GetMessagesForWeb`, `MessageFormatting.GetMessagesUserDefined`, `MessageFormatting.BuildMessageString` |
| **Entry point** | `SAIF.Application\AppManagerBase.vb`, `SAIF.Application\MessageFormatting.vb` |

## Steps

1. Concrete subclass calls `AppManagerBase.AppendMessageLines` with a single message, an array of messages, or an `IEnumerable(Of String)`.
   - Each candidate message is appended to `Message` only if it is non-empty and not already contained in the current message string ([BR-APP-001](../business-rules.md#br-app-001-non-empty%2C-non-duplicate-message-accumulation)).
   - On empty string: silently ignored.
   - On duplicate substring: not re-appended, preventing duplicate/blank message noise.
2. Independently, `MessageFormatting.GetMessagesForWindows`/`GetMessagesForWeb`/`GetMessagesUserDefined` de-duplicate a supplied message array (stripping embedded CRLF or `<BR>` sequences first) and concatenate the results with a CRLF, `<BR>`, or caller-supplied separator respectively, via the shared `BuildMessageString` helper.
   - This is a standalone utility operation not wired to `AppManagerBase.Message` in this library's own code.*

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Concrete subclass has a message]) --> S1{Path?}
	S1 -->|AppendMessageLines| S2{Message empty or duplicate?}
	S2 -->|Yes| S3([Ignored])
	S2 -->|No| S4[Append to Message]
	S1 -->|MessageFormatting.GetMessagesFor*| S5[Strip embedded CRLF/BR]
	S5 --> S6[BuildMessageString with separator]
	S4 --> EndOk([Message property updated])
	S6 --> EndOk2([Concatenated display string returned])
```

## Failure and edge-case behavior
- `MessageFormatting` operations are independent of `AppManagerBase.Message` in this library's own code; a caller must explicitly wire the two together if combined behavior is desired.*

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [API reference](../api/index.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts.

## Sources
- `SAIF.Application\AppManagerBase.vb`
- `SAIF.Application\MessageFormatting.vb`
